/***********************************************************************
 * Module:  Projection.java
 * Author:  Lionel
 * Purpose: Defines the Class Projection
 ***********************************************************************/

package projection;

/** @pdOid b7c9ade9-ddd2-4baf-b13b-f92832f78794 */
public class Projection {
   /** @pdOid efd5e594-cba6-444e-b110-7a19ece1db52 */
   private int idProjection;
   /** @pdOid 22bda41d-5040-4175-9d18-849ae0e675f5 */
   private String date;
   /** @pdOid 3263a965-4f1c-4aee-937e-e01f53c08ed7 */
   private int dureeProjection;
   
   /** @pdRoleInfo migr=no name=Vip assc=spectateur mult=1..* side=A */
   public String groupeVip;
   /** @pdRoleInfo migr=no name=Film assc=association3 mult=1..1 side=A */
   public String film;
   /** @pdRoleInfo migr=no name=Salle assc=association4 mult=1..1 side=A */
   public int salle;

    public Projection(int idProjection, String date, String film, int salle) {
        this.idProjection = idProjection;
        this.date = date;
        this.film = film;
        this.salle = salle;
    }

    public String getDate() {
        return date;
    }

    public int getDureeProjection() {
        return dureeProjection;
    }

    public String getFilm() {
        return film;
    }

    public int getSalle() {
        return salle;
    }

    public String getVip() {
        return groupeVip;
    }

    public void setDate(String date) {
        this.date = date;
    }

    public void setDureeProjection(int dureeProjection) {
        this.dureeProjection = dureeProjection;
    }

    public void setFilm(Film film) {
        this.film = film.getTitre();
    }

    public void setIdProjection(int idProjection) {
        this.idProjection = idProjection;
    }

    public void setSalle(Salle salle) {
        this.salle = salle.getIdSalle();
    }

    public void setVip(String vip) {
        this.groupeVip = vip;
    }
   
   /** @pdOid 14588d31-1faf-4385-9ba7-6d5094c228bc */
   public int getIdProjection() {
      return idProjection;
   }
   public Object getGetter(int col) {
        if (col == 0) {
            return this.getIdProjection();
        }
        if (col == 3) {
            return this.getSalle();
        }
        if (col == 1) {
            return this.getDate();
        }
        if (col == 2) {
            return this.getFilm();
        }
        if (col == 4) {
            return this.getDureeProjection();
        }
        if (col == 5) {
            return this.getVip();
        }


        return null;
    }
   public void setSetter(Object valu, int col) {
        if (valu instanceof Projection) {
            Projection value = (Projection) valu;
            if (col == 0) {
                this.setIdProjection(value.getIdProjection());
            }
            if (col == 3) {
                this.setSalle(value.getSalle());
            }
            if (col == 1) {
                this.setDate(value.getDate());
            }
            if (col == 2) {
                this.setFilm(value.getFilm());
            }
            if (col == 4) {
                this.setDureeProjection(value.getDureeProjection());
            }
            if (col == 5) {
                this.setVip(value.getVip());
            }

        }
    }

    private void setFilm(String film) {
        this.film=film;
    }

    private void setSalle(int salle) {
        this.salle=salle;
    }

    @Override
    public String toString() {
        return "Projection{" + "idProjection=" + idProjection + ",date=" + date + ",dureeProjection=" + dureeProjection + ",groupeVip=" + groupeVip + ",film=" + film + ",salle=" + salle + '}';
    }
    
}